package com.example.userservice.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "permission-service")
public interface PermissionService {
    @PostMapping("/permission/bind-default-role")
    void bindDefaultRole(@RequestParam("userId") Long userId);

    @GetMapping("/permission/user-role")
    String getUserRoleCode(@RequestParam("userId") Long userId);

    @PostMapping("/permission/upgrade-to-admin")
    void upgradeToAdmin(@RequestParam("userId") Long userId);

    @PostMapping("/permission/downgrade-to-user")
    void downgradeToUser(@RequestParam("userId") Long userId);

    /**
     * 创建用户角色关系
     */
    @PostMapping("/user-role")
    String createUserRole(@RequestParam("userId") Long userId,
            @RequestParam("roleCode") String roleCode);
}